﻿using ConfExpert.Forms.Base;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace ConfExpert.Forms.Depo
{
    public partial class TopListesi : XForm
    { 
        public TopListesi(string list)
        {
            InitializeComponent();
            
            btnOK.DialogResult = DialogResult.OK;
            memoEdit1.Text = list;
        }

        public string barcodes, toplar, raflar;
        List<string> topL = new List<string>();
        List<string> rafL = new List<string>();

        private void btnOK_Click(object sender, EventArgs e)
        {
            barcodes = memoEdit1.Text.Replace(Environment.NewLine, ",");

            string[] entries = memoEdit1.Text.Split(new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries);
            foreach (string entry in entries)
            {
                int i = intParse(entry);
                if (i > 0)
                    if (i < 1e9)
                        topL.Add(i.ToString());
                    else if (i < 2e9)
                        rafL.Add(i.ToString());
            }

            toplar = String.Join(",", topL.ToArray());
            raflar = String.Join(",", rafL.ToArray());
            this.DialogResult = DialogResult.OK;
        }

        private void TopListesi_Load(object sender, EventArgs e)
        {
            //memoEdit1.Text = "11416,522,11454,682,614,11415,713,565,11407,11387,94,633,11396,11388,11389,11393,195,11397,11455,3673,2253,5730,3692,4543,2154,1761,4201,395".Replace(",", Environment.NewLine);
        }


    }
}